<template>
    <div class="overview-echart" :style="{width: initCardParams.width, height: initCardParams.height}">
        <div class="head">
            <h3>{{cardName}}</h3>
        </div>
        <div class="overview-index" v-if="showText">
            <div>
                <p><span>{{showText.codingError}}</span>项</p>
                <p>编码缺陷</p>
            </div>
            <div>
                <p><span>{{showText.noCodingError}}</span>项</p>
                <p>非编码缺陷</p>
            </div>
        </div>
        <public-echarts :titleText="titleText" :echartData="echartData" :type="initCardParams.type"/>
    </div>
</template>

<script>
    import PublicEcharts from '@/components/PublicEcharts'

    export default {
        name: 'index',
        props: {
            showText: {
                type: Object
            },
            initCardParams: {
                type: Object
            },
            cardName: {
                type: String
            },
            echartData: {
                type: Array
            },
            titleText: {
                type: String
            }
        },
        components: {
            PublicEcharts
        }
    }
</script>

<style scoped lang="scss">
    .overview-echart {
        background: #fff;
        padding: 0 10px;
        .head {
            h3 {
                font-size: 16px;
                color: #000;
                font-weight: 600;
                line-height: 48px;
            }
        }
        .overview-index {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            padding-left: 40px;
            margin-bottom: 10px;
            div {
                min-width: 150px;
                margin-right: 20px;
                p {
                    font-size: 16px;
                    margin: 0;
                    span {
                        font-size: 20px;
                        font-weight: 600;
                    }
                }
            }
        }
    }
</style>
